package com.qboot.system.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.*;
import com.qboot.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;


/**
 * 权限 实体类
 *
 * @author Tellsea
 * @date 2022-12-17
 */
@Data
@ApiModel("权限")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class SysPermission extends BaseEntity {

    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 父菜单ID
     */
    @Excel(name = "父菜单ID")
    private Long parentId;
    /**
     * 菜单名称
     */
    @Excel(name = "菜单名称")
    private String menuName;
    /**
     * 路由地址
     */
    @Excel(name = "路由地址")
    private String path;
    /**
     * 组件路径
     */
    @Excel(name = "组件路径")
    private String component;
    /**
     * 路由参数
     */
    @Excel(name = "路由参数")
    private String query;
    /**
     * 是否外链 1-是 2-否
     */
    @Excel(name = "是否外链 1-是 2-否")
    private Integer isFrame;
    /**
     * 是否缓存 1-缓存 2-不缓存
     */
    @Excel(name = "是否缓存 1-缓存 2-不缓存")
    private Integer isCache;
    /**
     * 菜单类型 M-目录 C-菜单 F-按钮
     */
    @Excel(name = "菜单类型 M-目录 C-菜单 F-按钮")
    private String menuType;
    /**
     * 菜单状态 1-显示 2-隐藏
     */
    @Excel(name = "菜单状态 1-显示 2-隐藏")
    private Integer visible;
    /**
     * 权限标识
     */
    @Excel(name = "权限标识")
    private String perms;
    /**
     * 菜单图标
     */
    @Excel(name = "菜单图标")
    private String icon;
    /**
     * 显示顺序
     */
    @Excel(name = "显示顺序")
    private Integer sort;
    /**
     * 数据状态 1-正常 2-删除
     */
    @TableLogic
    @ApiModelProperty(hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private Integer deleteStatus;

    @TableField(exist = false)
    private List<SysPermission> children = new ArrayList<>();
}
